package cacco.jp.mld.panel.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class StringUtil {
	public static final String FORMAT_DATETIME = "yyyy/MM/dd HH:mm:ss";

	
	public static Date string2date(String value) {
	      SimpleDateFormat sdf = new SimpleDateFormat(FORMAT_DATETIME);  
	      try {  
	          return sdf.parse(value);  
	      } catch (Exception e) {  
	          return null;  
	      }  
	  } 
	
	
	public static String date2string(Date date) {
		String result = null;
		SimpleDateFormat sdf = new SimpleDateFormat(FORMAT_DATETIME);  
		result = sdf.format(date);
		return result;
	}
}
